package com.tanhua.sso.controller;

import com.tanhua.sso.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("user")
@Slf4j
public class UserContoller {

    @Autowired
    UserService userService;


    @PostMapping("/loginVerification")
    public String loginVerification(@RequestBody Map<String, String> Param) {

        //获取手机号和验证码
        String phone = Param.get("phone");
        String code = Param.get("code");
        log.info(phone + code);

        //调用登录验证方法
        String login = userService.login(phone, code);
        log.info(login);
        return "xxxx";
    }
}
